/**
 * Created by qunxing.du on 2016/7/13.
 * Copyright 2016 汉威.智慧环保事业部 Limited.
 * All rights reserved.
 */
package com.hw.one.collect.zzcity.job;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 原始日均数据job
 */
@Component
public class ZzCityRawDayAvgJob extends ZzCityJob{


    @Override
    public void start(){

        Map<String,String> map = new HashMap<>();
        Calendar c = Calendar.getInstance();
        Date curDate = c.getTime();
        c.add(Calendar.HOUR_OF_DAY,-RAW_DAYAVG_INTERVAL);
        Date prevDate = c.getTime();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
        String endDate = sdf.format(curDate);
        String startDate = sdf.format(prevDate);
        map.put("startTime",startDate);
        map.put("endTime",endDate);
        map.put("isSrc",RAW);
        map.put("dataType",RAW_DAYAVG_DATATYPE);
        execute(map);
    }
}
